<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">
        
    </div>
    <template id="comp1">
        <h1>
            我的组件 <hr>
            <slot></slot>
        </h1>
    </template>
    <template id="comp2">
        <div>
            <slot name="s1"></slot>
            <hr>
            <slot name="s2"></slot>
        </div>
    </template>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
    var vm = new new Vue({
        el:"#app",
        components: {
            "my-parent":{
                template:"#comp1",
                components: {
                    "my-child":{
                        template:"#comp2"
                    }
                }
            }
        }
    })
    </script>
</body>
</html>